package pl.myapp.webtest.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pl.myapp.webtest.config.qualifier.MyLogger;
import pl.myapp.webtest.qualifier.annotation.StringOne;
import pl.myapp.webtest.qualifier.annotation.StringTwo;

import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;

/**
 * Created by IntelliJ IDEA.
 * User: kaafaar
 * Date: 15.05.11
 * Time: 00:34
 * To change this template use File | Settings | File Templates.
 */
public class SimpleConfig {
	@MyLogger
    @Produces
    public Logger getLogger(InjectionPoint injectionPoint) {
        Logger logger = LoggerFactory.getLogger(injectionPoint.getMember().getDeclaringClass().getSimpleName());
        //logger.info("Wstrzykniecie Log z "+injectionPoint.getMember().getDeclaringClass().getSimpleName());
        return logger;
    }

    @StringOne
    @Produces
    public String createStringOne(InjectionPoint injectionPoint) {
        return "wygenerowany stringOne";
    }

    @StringTwo
    @Produces
    public String createStringTwo(InjectionPoint injectionPoint) {
        return "wygenerowany stringTwo";
    }
}
